﻿function process(params) {
    var idField = params.idField;
    var nameField = params.nameField;
    var selectedId = document.getElementById(idField).value;
    var selectedText = document.getElementById(nameField).value;

    var returnValue = showCenterModalDialog(Global.contextPath + '/Modules/SecurityConsole/Common/FunctionControl/CategorySelect/CategorySelect.aspx', 650, 500,
					{
					    title: params.title,
					    sqlId: params.sqlId,
					    childSqlId: params.childSqlId,
					    selectedId: selectedId,
					    selectedText: selectedText,
					    params: params.params,
					    isAsyn: params.isAsyn,
					    dataProvider: params.dataProvider
					}
				);

    if (!returnValue) return;

    var idField = params.idField;
    var nameField = params.nameField;

    document.getElementById(idField).value = returnValue.id;
    document.getElementById(nameField).value = returnValue.text;
    var callback = params.callback;
    if (callback) {
        callback(returnValue.id, returnValue.text);
    }
}